
SHELL = /bin/sh


#----------------------------------------------------------- SETUP

TOPDIR = ../..
include $(TOPDIR)/Makefile.common

JAVAC = javac -classpath $(SSFNET_TEST_CLASSPATH):$(PTII)
JAVA  = java -mx1024m -classpath $(SSFNET_TEST_CLASSPATH):$(PTII)

# plot parameters

DATA_FILE = tcp_selfsim.dat.0

WIN_SW   = -window 386		# moving window size in n.o. data points. Set 
				# to something that looks good w.r.t 
				# n.o. pixels
WINH_SW  = -win_heights 170	# height of each plot in n.o. pixels
BIN_SZ   = 1			# time bin size in [s]
#DELAY_SW =			# delay between each data point [ms]
DELAY_SW = -delay 5		# 
#DELAY_SW = -delay 10		# use this for 800 MHz Pentium


# experiment parameters

#SIM_TIME = 3000			# simulation duration [s]
SIM_TIME = 500			# simulation duration [s]


#----------------------------------------------------------- MAKE ALL

#all: plot data

plot:
	@echo
	@echo '---------------- plotting time-series of Two-stage TCP C/S network (see README file)'
	@echo
	$(JAVA) SSF.Util.Plot.TimeSeries -live $(WIN_SW) -binsize $(BIN_SZ) $(WINH_SW) $(DELAY_SW) -filter filters/h1_1q.dml,pktcnt -filter filters/r1_0q.dml,pktcnt -filter filters/r1_0q.dml,qlen -filter filters/r1000_0q.dml,pktcnt $(DATA_FILE)
	@echo
	@echo '---------------- plot COMPLETED'
	@echo

data:
	@echo
	@echo '---------------- running Two-stage TCP C/S network (see README file).'
	@echo '---------------- 3000 seconds takes about 6 mins on a 750 MHz Pentium III'
	@echo
	$(JAVA) SSF.Net.Net $(SIM_TIME) tcp_self_sim_demo.dml $(TOPDIR)/examples/net.dml > tcp_self_sim_demo.out 2>&1

	@echo
	@echo '---------------- Two-stage TCP C/S network example COMPLETED (see tcp_self_sim_demo.out)'
	@echo

clean:
	rm -f *.out
